package com.player.thirdGroup.dao;

import com.player.thirdGroup.entity.Dept;
import com.player.thirdGroup.entity.Log;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author VULCAN
 * @create 2019-12-27 21:29
 * @desc 账号
 **/
public interface DeptDao extends JpaRepository<Dept, String> {

    @Query(value = "select count(*) from sys_dept where dept_status = '0'",nativeQuery = true)
    public String countunder();

    @Query(value = "select count(*) from sys_dept where dept_status = '1'",nativeQuery = true)
    public String countpass();

    @Query(value = "select count(*) from sys_dept where dept_status = '2'",nativeQuery = true)
    public String countnopass();

    List<Dept> findByStatus(String status);
    @Query(value = "select * from sys_dept where dept_id in (select max(dept_id) from sys_dept group by dept_name)",nativeQuery = true)
    List<Dept> findAdministrationList();
}
